# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: eolianoe <eolianoe [at] gmail [DoT] com>
# Contributor: Romain Schmitz <slopjong .at. slopjong .dot. de>

pkgname=python-sphinx_rtd_theme
pkgver=1.2.0
pkgrel=4
pkgdesc='Read the Docs theme for Sphinx'
arch=('any')
url=https://github.com/readthedocs/sphinx_rtd_theme
license=('MIT')
depends=('python-sphinx' 'python-sphinxcontrib-jquery')
makedepends=('nodejs' 'npm' 'python-setuptools-scm' 'python-build' 'python-installer' 'python-wheel')
source=("$url/archive/$pkgver/sphinx_rtd_theme-$pkgver.tar.gz")
b2sums=('25184f0b810ebe0f346a87e5651243c1b740bd1803ec57c5f842527f245cf60f614b7973e19a2c11f4482d84efaff9c1549923947d0597d36acf18200fa5193b')

prepare() {
  cd sphinx_rtd_theme-$pkgver
  npm ci
}

build() {
  cd sphinx_rtd_theme-$pkgver
  npm run build
  python -m build --wheel --no-isolation
}

package() {
  cd sphinx_rtd_theme-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
}

# vim:set ts=2 sw=2 et:
